home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5266 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: lrz-muenchen.de!news
  2. From: ua302aa@lrz-muenchen.de ()
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Limit on #bytes inside of struct?
  5. Date: 9 Feb 1996 12:54:35 GMT
  6. Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
  7. Distribution: world
  8. Message-ID: <4ffg6b$ivd@sparcserver.lrz-muenchen.de>
  9. References: <4feg1d$d4g@cville-srv.wam.umd.edu>
  10. NNTP-Posting-Host: sun2.lrz-muenchen.de
  11.  
  12. jsquires@wam.umd.edu (jeffrey d squires) writes:
  13.  
  14. >I have the following:
  15.  
  16. >typedef struct {
  17. >        int zero;
  18. >        int one;
  19. >        int two;
  20. >        int three;
  21. >        int four;
  22. >        int five;
  23. >        int six;
  24. >        int seven_or_more;
  25. >} hist_type;
  26.  
  27. >hist_type histogram;
  28. >int num=2;
  29.  
  30. >histogram.four = 0;  /* at this point, value of num changes from 2 to 0!!!*/
  31.  
  32. >Is there a limit on the number of bytes allowed inside of a struct?
  33.  
  34. Yes, there is a limit on the number of bytes allowed in one 
  35. object. That limit is 32k. 
  36.  
  37. >I am positive that the value of num changes from 2 before the last 
  38. >assignment to 0 after it.  Any ideas? 
  39.  
  40. Not really :-(. It you can post a minimal example that demonstrates
  41. this error, it might be possible to find the problem.
  42.  
  43. >Is this a bug in gcc?
  44.  
  45. Very improbable!
  46.  
  47. >Unix?
  48.  
  49. Even less probable, because the OS usually does not write into memory
  50. allocated for a user process without a good reason.
  51.  
  52. Kurt
  53. --
  54. | Kurt Watzka                             Phone : +49-89-2180-6254
  55. | watzka@stat.uni-muenchen.de
  56. | ua302aa@sunmail.lrz-muenchen.de
  57.